package com.example.ioc.context;

import com.example.common.utils.Statistics;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 该方法需要在启动类上用{@link org.springframework.context.annotation.Import}
 */
@Slf4j
public class LImportBeanDefinitionRegister implements ImportBeanDefinitionRegistrar {

    private LImportBeanDefinitionRegister(){
        Statistics.logInfo(log);
    }

    @Override
    public void registerBeanDefinitions(@NonNull AnnotationMetadata importingClassMetadata,
                                        @NonNull BeanDefinitionRegistry registry) {
        Statistics.logInfo(log, "registerBeanDefinitions", registry);
    }
}
